﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace ADSTS_SERVER.Models
{
    /// <summary>
    /// 用户表
    /// </summary>
    [SugarTable("user", TableDescription = "用户表")]
    public class User
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "id", ColumnDescription = "主键ID")]
        public long Id { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [SugarColumn(ColumnName = "username", ColumnDescription = "用户名")]
        public string Username { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [SugarColumn(ColumnName = "password", ColumnDescription = "密码")]
        public string Password { get; set; }

        /// <summary>
        /// 真实姓名
        /// </summary>
        [SugarColumn(ColumnName = "realname", ColumnDescription = "真实姓名")]
        public string Realname { get; set; }

        /// <summary>
        /// 部门
        /// </summary>
        [SugarColumn(ColumnName = "department", ColumnDescription = "部门")]
        public string Department { get; set; }

        /// <summary>
        /// 角色
        /// </summary>
        [SugarColumn(ColumnName = "role", ColumnDescription = "角色")]
        public string Role { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        [SugarColumn(ColumnName = "email", ColumnDescription = "邮箱")]
        public string Email { get; set; }

        /// <summary>
        /// 联系方式
        /// </summary>
        [SugarColumn(ColumnName = "phone", ColumnDescription = "联系方式")]
        public string Phone { get; set; }

        /// <summary>
        /// 是否激活数据 1-是 0-否
        /// </summary>
        [SugarColumn(ColumnName = "isactive", ColumnDescription = "是否激活数据 1-是 0-否")]
        public int IsActive { get; set; } = 1;

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnName = "created", IsOnlyIgnoreUpdate = true)]
        public DateTime Created { get; set; } = DateTime.Now;

        /// <summary>
        /// 更新时间
        /// </summary>        
        [SugarColumn(ColumnName = "updated")]
        public DateTime Updated { get; set; } = DateTime.Now;

    }
}
